package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName maintenance_plan
 */
@TableName(value ="maintenance_plan")
@Data
public class MaintenancePlan implements Serializable {
    /**
     * 计划编码,主键不自增

     */
    @TableId
    private String planNo;

    /**
     * 计划名称
     */
    private String planName;

    /**
     * 计划类型（0设备保养计划，1设备点检计划）
     */
    private String planType;

    /**
     * 频率
     */
    private String frequency;

    /**
     * 频率单位编号（外键）
     */
    private Integer frequencyUnitId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    /**
     * 状态（0未启用，1启用）
     */
    private String status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 备用列1
     */
    private String columnOne;

    /**
     * 备用列2
     */
    private String columeTwo;

    /**
     * 备用列3
     */
    private String columeThree;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MaintenancePlan other = (MaintenancePlan) that;
        return (this.getPlanNo() == null ? other.getPlanNo() == null : this.getPlanNo().equals(other.getPlanNo()))
            && (this.getPlanName() == null ? other.getPlanName() == null : this.getPlanName().equals(other.getPlanName()))
            && (this.getPlanType() == null ? other.getPlanType() == null : this.getPlanType().equals(other.getPlanType()))
            && (this.getFrequency() == null ? other.getFrequency() == null : this.getFrequency().equals(other.getFrequency()))
            && (this.getFrequencyUnitId() == null ? other.getFrequencyUnitId() == null : this.getFrequencyUnitId().equals(other.getFrequencyUnitId()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getColumnOne() == null ? other.getColumnOne() == null : this.getColumnOne().equals(other.getColumnOne()))
            && (this.getColumeTwo() == null ? other.getColumeTwo() == null : this.getColumeTwo().equals(other.getColumeTwo()))
            && (this.getColumeThree() == null ? other.getColumeThree() == null : this.getColumeThree().equals(other.getColumeThree()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPlanNo() == null) ? 0 : getPlanNo().hashCode());
        result = prime * result + ((getPlanName() == null) ? 0 : getPlanName().hashCode());
        result = prime * result + ((getPlanType() == null) ? 0 : getPlanType().hashCode());
        result = prime * result + ((getFrequency() == null) ? 0 : getFrequency().hashCode());
        result = prime * result + ((getFrequencyUnitId() == null) ? 0 : getFrequencyUnitId().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getColumnOne() == null) ? 0 : getColumnOne().hashCode());
        result = prime * result + ((getColumeTwo() == null) ? 0 : getColumeTwo().hashCode());
        result = prime * result + ((getColumeThree() == null) ? 0 : getColumeThree().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", planNo=").append(planNo);
        sb.append(", planName=").append(planName);
        sb.append(", planType=").append(planType);
        sb.append(", frequency=").append(frequency);
        sb.append(", frequencyUnitId=").append(frequencyUnitId);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", columnOne=").append(columnOne);
        sb.append(", columeTwo=").append(columeTwo);
        sb.append(", columeThree=").append(columeThree);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}